import React, { Component } from 'react';
import {
    View,
    StyleSheet,
    Button,
    TouchableOpacity,
    Text,
    TouchableNativeFeedback

} from 'react-native';
import BaseComponentF from './BaseComponentF';
import RNBtn from '../component/RNBtn';

class RNBtnDemo extends Component {

    render() {
        return (
            <View style={Style.container}>
                <Button onPress={()=>alert('click!')} title="click me" style={{ width: 300, height: 90, }} />
                <TouchableNativeFeedback onPress={this.showText}>
                    <Text style={Style.button}>click me</Text>
                </TouchableNativeFeedback>
            </View>

        );
    }

    showText(){
        alert(`Hello${this}`);
    }
}

const Style = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
    },
    button: {
        borderRadius:5,
        textAlign:'center',
        alignSelf: 'center',
        backgroundColor: 'blue',
        color: 'white',
        width: 90,
        height: 35,
        lineHeight:35
    }
});







export default BaseComponentF(RNBtnDemo);
